﻿@{
    Layout = null;
}
@model ZBZH_Manage_Order.Controllers.MerchantsSettings.Order_FormController.Zcd
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>订单明细</title>
    @*<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/demo/demo.css">
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>*@
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/demo.css">
    <script src="~/Scripts/jquery-1.7.1.js"></script>
    @*<script type="text/javascript" src="~/Content/jquery-easyui-1.4.2/jquery.min.js"></script>*@
    <script type="text/javascript" src="~/Content/jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
    <script src="~/Content/jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script>
    <link href="~/Content/Styles/Order.css" rel="stylesheet" /> 
 
    <script src="~/Scripts/jquery.jgrowl.js"></script>
    <link href="~/Scripts/jquery.jgrowl.css" rel="stylesheet" />
    <script src="~/Scripts/jquery.signalR-2.2.0.js"></script>
    <script src="~/signalr/hubs"></script>

    @*------------------------- 打印方法-------------------- *@
     <script type="text/javascript">

         function doPrint() {
             var FormID = $('#FormID').textbox('getValue');
             var FormTime = $('#FormTime').textbox('getValue');
             var FormPayType = $('#FormPayType').textbox('getValue');
             var IsPay = $('#IsPay').textbox('getValue');
             var SenTime = $('#SenTime').textbox('getValue');
             //var SenTime = st.substring(0, 4) + "/" + st.substring(4, 6) + "/" + st.substring(6, 8) + " " + st.substring(8, 10) + ":" + st.substring(10, 12) + ":" + st.substring(12, 14);
             var AccCall = $('#AccCall').textbox('getValue');
             var AccName = $('#AccName').textbox('getValue');
             var FormAddress = $('#FormAddress').textbox('getValue');
             var FormPreMon = $('#FormPreMon').textbox('getValue');
             var FormPayMon = $('#FormPayMon').textbox('getValue');
             var FormPayInt = $('#FormPayInt').numberbox('getValue');
             var IntBZ = $('#IntBZ').textbox('getValue');
             var MerBZ = $('#MerBZ').textbox('getValue');
             var DelPackMon = $('#DelPackMon').textbox('getValue');
             var DelFormMon = $('#DelFormMon').textbox('getValue');
             @*------------------------- 菜品循环-------------------- *@
             var allrows = $('#tableDishes').datagrid('getRows')

             mywindow = window.open("", 'width=200,height=300')
             mywindow.document.write("<!DOCTYPE html><html><head><style>html{height:auto;}</style> </head>");
             mywindow.document.write("<center><h3> " + diplayText + "</h3></center>订单号："
                 + FormID + "<br/>下单时间："
                 + FormTime + "<br/>送餐时间："
                 + SenTime
                 + "<br/><br/><table><tr><th >商品名称 </th><th>单价</th><th>积分</th><th>数量</th><th>小计</th></tr>");
             for (var i = 0; i < allrows.length; i++) {
                 console.log(allrows.length);
                 var a = allrows[i].FormDisheName;
                 var b = allrows[i].FormDishesMon;
                 var c = allrows[i].FornDishesInt;
                 var d = allrows[i].FormDishesNun;
                 var e = allrows[i].FornDishesCount;
                 var f = allrows[i].DelPackMon;
                 var g = allrows[i].DelFormMon;

                 mywindow.document.write("<tr><td align=\"center\">"
                + a + "</td><td align=\"center\">" + b + "</td><td align=\"center\">" + c + "</td><td align=\"center\">" + d + "</td><td align=\"center\">" + e + "</td></tr>");
             }
             @*------------------------- 菜品循环-------------------- *@

             mywindow.document.write("</table>"
             + "<br/>已优惠："
             + FormPreMon + "元<br/>包装费："
             + DelPackMon + "元<br/>配送费："
             + DelFormMon + "元<br/>实际支付金额："
             + FormPayMon + "元 <br/>消耗积分："
             + FormPayInt + "<br/>联系方式："
             + AccCall + "<br/>客户姓名："
             + AccName + "<br/>送餐地点："
             + FormAddress + "<br/>客户备注："
             + IntBZ + "");
             mywindow.document.write("</body><html>");
             mywindow.print();

             

         }
         @*------------------------- 打印方法-------------------- *@

    @*<script>*@
         $(function () {
             GetMer();//加载操作员管理的所有商户
             $('#btndetail').linkbutton('disable');
             $('#btnedit').linkbutton('disable');

         })
         var FormBY = "";
         var Mer;//商户ID
         var diplayText;//商户名称

         function getformid() {  //czx:获取当前商户的最大订单ID
             var formid = $('#View').datagrid('getData');
             var ddh = formid.rows[0].FormID;

             document.getElementById("orderid").value = ddh;
             
         }
         //获取商户
         function GetMer() {
             var grid = $('#SearchMer').combogrid({
                 panelWidth: 500,
                 idField: 'MerID',
                 textField: 'MerName',
                 url: '/Order_Form/getMer',
                 method: 'post',
                 pageSize: 5,
                 pageList: [5],
                 pagination: true,
                 rownumbers: true,
                 fitColumns: true,
                 columns: [[
                     { field: 'MerID', title: '商户ID', width: 80, align: 'center' },
                     { field: 'MerName', title: '商户名称', width: 80, align: 'center' },
                     { field: 'MerTxt', title: '商户介绍', width: 120, align: 'center' },
                     { field: 'MerAdr', title: '商户地址', width: 80, align: 'center' },
                     { field: 'MerCall', title: '商户联系电话', width: 80, align: 'center' }
                 ]],
                 onSelect: function (index, row) {
                     diplayText = row[grid.combogrid('options').textField];
                     Mer = $('#SearchMer').combogrid("getValue");//获取操作员
                     //加载对应订单
                     initTable(Mer);
                     
                     //加载对应订单状态
                     GetOrder_FormType();
                     //控制增删查改的权限
                     $.post("/Order_Form/getPower", function (database) {
                         if (database != "") {
                             $('#btndetail').linkbutton('enable');
                             if (database.Edit == 1) {
                                 $('#btnedit').linkbutton('enable');
                             }
                         }
                     })
                    
                 },
                 onLoadSuccess: function () {
                     //分页后判断下是否有选中的数据行，combogrid会依据上一次选中的值进行初始化，选中datagrid数据行和设置显示值
                     if (!grid.combogrid('grid').datagrid('getSelected'))//不在当前页
                     {
                         $('#SearchMer').combogrid("setValue", diplayText);
                     }
                 }
             });

         }
         //订单信息datagrid
         function initTable(item) {
             $('#View').datagrid({
                 iconCls: 'icon-user',
                 loadMsg: '数据加载中...',
                 fitColumns: true,
                 nowrap: true,
                 autoRowHeight: true,
                 striped: true,
                 url: '/Order_Form/getgrid?MerID=' + item,
                 //sortName: 'FormID',
                 sortOrder: 'asc',
                 border: true,
                 remoteSort: false,
                 singleSelect: true,
                 idField: 'FormID',
                 pagination: true,
                 rownumbers: true,
                 columns: [[
                     { field: 'FormID', title: '订单ID', sortable: true },
                     { field: 'MerName', title: '商户名称', sortable: true },
                     { field: 'ConText', title: '订单状态' },
                     { field: 'AccName', title: '客户姓名', sortable: true },
                     { field: 'AccCall', title: '客户电话', sortable: true },
                     { field: 'FormDishesID', title: '菜品ID集合', hidden: true },
                     { field: 'FormDisheName', title: '菜品名称集合', hidden: true },
                     { field: 'FormDishesNun', title: '菜品数量集合', hidden: true },
                     { field: 'FormDishesMon', title: '菜品原单价集合', hidden: true },
                     { field: 'FornDishesInt', title: '菜品积分集合', hidden: true },
                     {
                         field: 'FormPayType', title: '支付类型', formatter: function (val, rowdata, index) {
                             if (val == 0) {
                                 return '现金';
                             } else if (val == 1) {
                                 return '钱包支付';
                             } else if (val == 2) {
                                 return '第三方支付';
                             } else if (val == null) {
                                 return '挂账';
                             } else if (val == 3) {
                                 return '企业支付'
                             }
                         }
                     },
                     {
                         field: 'IsPay', title: '支付状态', formatter: function (val, rowdata, index) {
                             if (val == 0) {
                                 return '未支付';
                             } else if (val == 2) {
                                 return '已支付';
                             } else if (val == 3) {
                                 return '支付失败';
                             } else if (val == 4) {
                                 return '现金支付';
                             } 
                         }
                     },
                     {
                         field: 'IsTake', title: '是否派送', formatter: function (val, rowdata, index) {
                             if (val == 1) {
                                 return '是';
                             } else if (val == 2) {
                                 return '否';
                             } 
                         }
                     },
                     { field: 'FormAddress', title: '配送地址' },
                     {
                         field: 'SenTime', title: '送餐时间', formatter: function (val, rowdata, index) {
                             if (val == 0) {
                                 return '立刻送餐'
                             }
                             else {
                                 return val;
                             }
                         }
                     },
                     { field: 'FormTime', title: '订单生成时间' },
                     { field: 'IntBZ', title: '备注' },
                 ]],
                 toolbar: '#tb1',
                 onLoadSuccess: function () {
                     getformid();
                 }
             });
             
         }

         //商品集合datagrid
         function DishesTable(item) {
             $('#tableDishes').datagrid({
                 loadMsg: '数据加载中...',
                 fitColumns: false,
                 nowrap: true,
                 autoRowHeight: true,
                 striped: true,
                 url: '/Order_Form/getDishesgrid?Dishes=' + item,
                 sortName: '',
                 sortOrder: '',
                 singleSelect: true,
                 border: true,
                 remoteSort: false,
                 idField: '',
                 pageSize: 30,
                 pageList: [30],
                 pagination: true,
                 rownumbers: true
             });
         }

         //获取订单状态
         function GetOrder_FormType() {
             $.get("/Order_Form/getOrderFormType", {}, function (database) {

                 var a = {
                     ConText: "全部",
                     ConID: -8989,
                 }

                 database.splice(0, 0, a);

                 $('#FormControl').combobox({
                     textField: "ConText",
                     valueField: "ConID",
                     data: database,
                     multiple: true,
                     editable: false,
                     formatter: function (row) {
                         //console.log(row);
                         var opts;
                         if (row.selected == true) {
                             opts = "<input type='checkbox' checked='checked' id='" + row.ConID + "' value='" + row.ConID + "'>" + row.ConText + "</input>";
                         } else {
                             opts = "<input type='checkbox' id='" + row.ConID + "' value='" + row.ConID + "'>" + row.ConText;
                         }
                         return opts;
                     },
                     panelHeight: "auto",
                     onSelect: function (rec) { // 选中一个选项
                         //console.log(rec);
                         oCheckbox = document.getElementById(rec.ConID);
                         //console.log(oCheckbox);
                         if (oCheckbox.id == -8989) { // -8989“全部”选项的id  
                             for (var i = 0; i < ($("input:checkbox").length - 1); i++) {  // html中有一个复选按钮所以长度-1
                                 //console.log(i);
                                 $("input:checkbox")[i].checked = true; // 复选框勾选
                                 $('#FormControl').combobox('select', $("input:checkbox")[i].id);  // 选定下拉选项的值
                             }
                             return false;
                         }
                         oCheckbox.checked = true;
                         if ($("input[type='checkbox']:checked").length == ($("input:checkbox").length - 2)) { 
                             for (var i = 0; i < ($("input:checkbox").length - 1) ; i++) {
                                 //console.log(i);
                                 $("input:checkbox")[i].checked = true;
                                 $('#FormControl').combobox('select', $("input:checkbox")[i].id);
                             }
                             return false;
                         }
                     }, onUnselect: function (rec) { // 取消一个选项
                         oCheckbox = document.getElementById(rec.ConID);
                         var a = $("#FormControl").combobox('getValues');
                         console.log(a);
                         if (oCheckbox.id == -8989) { // 是否是“全部”选项的id
                             for (var i = 0; i < ($("input:checkbox").length - 1) ; i++) {
                                 $("input:checkbox")[i].checked = false; // 复选框不勾选
                                 $('#FormControl').combobox('clear', 'none'); // 清除组合框（combobox）的值。
                             }
                         } else if (a.indexOf("-8989") >= 0) { // ”全部“选项是否处于选中状态
                             oCheckbox.checked = false; // 
                             document.getElementById("-8989").checked = false;
                             var value = $("#FormControl").combobox('getValues') // 获取所有值
                             $('#FormControl').combobox('clear', 'none'); // 清除组合框（combobox）的值。
                             value.splice(jQuery.inArray('-8989', value), 1); // 在数组中删除“-8989”
                             for (var i in value) {
                                 $('#FormControl').combobox('select', value[i]);
                             }
                         } else {
                             oCheckbox.checked = false;
                         }
                     }


                 })
                 //var a = {
                 //    "ConID": "",
                 //    "ConText": "全部",
                 //}

                 ////database.push(a)
                 //database.splice(0, 0, a); // 将全部的选项放在最前
                 //$('#FormControl').combobox({
                 //    valueField: 'ConID',
                 //    textField: 'ConText',
                 //    value: '',
                 //    text: '全部',
                 //    data: database
                 //});
             })
         }

         //修改商品信息对话框
         function UpdateDialog() {
             var UpdateInfoID = $("#View").datagrid("getSelections");
             if (UpdateInfoID.length == 1) {
                 $("#editDialog").dialog("open").dialog("setTitle", "修改订单信息");
                 if (UpdateInfoID[0].IsPay == 0 || UpdateInfoID[0].IsPay == 3) { // 是否处于已支付状态
                     $("#inputDIV").css("display", "none");
                 } else {
                     $("#inputDIV").css("display", "block");
                 }
                 nextFormBY(UpdateInfoID[0].FormID);
                 BingUpdate(1);
                 //DishesTable();
                 //document.getElementById("ok").style.display = "block";
             }
             else {
                 $.messager.alert("友情提示", "每次只能修改一行数据，你已经选择了<font color='red' size='6'>" + UpdateInfoID.length + "</font>行");
             }
         }

         //商品信息明细对话话框
         function DetailDialog() {
             
             var UpdateInfoID = $("#View").datagrid("getSelections");
             if (UpdateInfoID.length == 1) {
                 $("#editDialog").dialog("open").dialog("setTitle", "查看订单明细");
                 $("#inputDIV").css("display", "none");//明细---下拉框隐藏
                 BingUpdate(0);
             }
             else {
                 $.messager.alert("友情提示", "每次只能查看一行数据，你已经选择了<font color='red' size='6'>" + UpdateInfoID.length + "</font>行");
             }
         }

         //商品检索
         function Search() {
             var FormControl = $('#FormControl').combobox("getValues");
             if (FormControl.indexOf("-8989") >= 0) {
                 FormControl = "";
             }
             var FormTimeS = $('#FormTimeS').datebox('getValue');
             var FormTimeE = $('#FormTimeE').datebox('getValue');
             //if (FormControl != "" || FormTimeS != "" || FormTimeE != "") {
                 if (FormTimeS > FormTimeE)
                 {
                     $.messager.alert("友情提示", "开始日期不能大于结束日期");
                 }
             else
             {
                 $('#View').datagrid({
                     url: '/Order_Form/searchForm?MerID=' + Mer + "&FormControl=" + FormControl + "&FormTimeS=" + FormTimeS + "&FormTimeE=" + FormTimeE,
                 });
                 }
             //}
             //else {
             //    $.messager.alert("友情提示", "请输入搜索条件");
             //}
        
         }

         //给商品订单编辑界面赋值
         function BingUpdate(IsButton) {
             $("#MerBZ").textbox("setValue", "");
             document.getElementById("SaveButton").innerHTML = "";
             //首先获取选中的商品订单
             var checkdata = $("#View").datagrid("getSelections")[0];
             console.log(checkdata);
             if (checkdata != null) {
                 var FormPayType = checkdata.FormPayType;
                 switch (checkdata.FormPayType) {
                     case 0:
                         FormPayType = "现金";
                         break
                     case 1:
                         FormPayType = "钱包支付";
                         break
                     case 2:
                         FormPayType = "第三方支付";
                         break
                 }
                 var IsPay = checkdata.IsPay;
                 switch (checkdata.IsPay) {
                     case 0:
                         IsPay = "未支付";
                         break
                     case 2:
                         IsPay = "已支付";
                         break
                     case 3:
                         IsPay = "支付失败";
                         break
                     case 4:
                         IsPay = "现金支付";
                         break
                 }
                 var FormBY = checkdata.FormBY;  //订单状态;
                 var SenTime = checkdata.SenTime;
                 var FormTime = checkdata.FormTime;
                 if (IsButton == 1) {
                     //AddButton(FormBY);
                 }
                 $("#FormBY").text(checkdata.ConText);
                 $("#FormID").textbox('setValue', checkdata.FormID);
                 $("#FormTime").textbox('setValue', FormTime);
                 $("#FormPayType").textbox('setValue', FormPayType);
                 $("#IsPay").textbox('setValue', IsPay);
                 $("#SenTime").textbox('setValue', SenTime);
                 $("#AccCall").textbox('setValue', checkdata.AccCall);
                 $("#AccName").textbox('setValue', checkdata.AccName);
                 $("#MerName").textbox('setValue', checkdata.MerName);
                 $("#FormAddress").textbox('setValue', checkdata.FormAddress);
                 console.log(checkdata.DelFormMon);
                 $("#DelFormMon").textbox('setValue', (checkdata.DelFormMon * 0.01).toFixed(2));
                 $("#DelPackMon").textbox('setValue', (checkdata.DelPackMon * 0.01).toFixed(2));
                 if (checkdata.IsEva == 0)
                 { $("#IsEva").attr("checked", ''); }
                 if (checkdata.IsEva == 1) {
                     $("#IsEva").attr("checked", true);
                 }
                 $("#FormPreMon").textbox('setValue', (checkdata.FormPreMon * 0.01).toFixed(2)) //优惠
                 $("#FormPayMon").textbox('setValue', (checkdata.FormPayMon * 0.01).toFixed(2)) //实际支付
                 $("#FormPayInt").numberbox('setValue', checkdata.FormPayInt) //消费积分
                 $("#IntBZ").textbox('setValue', checkdata.IntBZ) //备注
                 if (checkdata.IsTake == 1) {
                     $("#isTake").textbox('setValue', "是") //派送
                 } else {
                     $("#isTake").textbox('setValue', "否") //派送
                 }
                 var a = checkdata.FormDishesID + "|" + checkdata.FormDisheName + "|" + checkdata.FormDishesNun + "|" + checkdata.FormDishesMon + "|" + checkdata.FornDishesInt;
                 DishesTable(a);
             }
         }

         //新增按钮
         function AddButton(FormBY) {
             $.post("/Order_Form/SeachOrderFormType?FormBY=" + FormBY, {}, function (database) {
                 if (database != null) {
                     var js = database.rows;
                     var count = database.total;
                     if (count > 0) {
                         for (var i = 0; i < count; i++) {
                             var mydiv = document.getElementById("SaveButton");
                             var input = document.createElement("input");
                             input.className = "easyui-linkbutton";
                             input.type = "button";
                             input.id = js[i].id;
                             input.value = js[i].name;
                             input.onclick = function (evt) {
                                 //使用异步实现修改用户信息
                                 $.post("/Order_Form/UpdateOrder_Form?FormID=" + $("#FormID").textbox('getValue') + "&MerID=" + Mer + "&FormBY=" + evt.target.id + "&IntBZ=" + $("#IntBZ").textbox('getValue') + "&MerBZ=" + $("#MerBZ").textbox('getValue'), {}, function (date) {
                                     if (date == "1") {
                                         $("#editDialog").dialog('close');
                                         $("#View").datagrid('reload');
                                     }
                                     else {
                                         $.messager.alert("友情提示", "修改失败，请检查");
                                     }
                                 });
                             }
                             mydiv.appendChild(input)
                         }
                     }
                     else//如果没有下一个选择按钮就只能保存普通信息
                     {
                         var mydiv = document.getElementById("SaveButton");
                         var input = document.createElement("input");
                         input.className = "easyui-linkbutton";
                         input.type = "button";
                         input.id = 0;
                         input.value = "保存";
                         input.onclick = function () {
                             //保存事件
                             var postdata = {
                                 FormID: $("#FormID").textbox('getValue'),//订单ID
                                 MerID: Mer,//商户ID
                                 FormBY: FormBY,//订单状态
                                 IntBZ: $("#IntBZ").textbox('getValue'),//原来备注
                                 MerBZ: $("#MerBZ").textbox('getValue')//商户追加的备注
                             };
                             $.post("/Order_Form/UpdateOrder_Form?FormID=" + postdata.FormID + "&MerID=" + postdata.MerID + "&FormBY=" + postdata.FormBY + "&IntBZ=" + postdata.IntBZ + "&MerBZ=" + postdata.MerBZ, {}, function (date) {
                                 if (date == "1") {
                                     $("#editDialog").dialog('close');
                                     $("#View").datagrid('reload');
                                 }
                                 else {
                                     $.messager.alert("友情提示", "修改失败，请检查");
                                 }
                             });
                             //alert("执行方法");
                         }
                         mydiv.appendChild(input)
                     }
                 }
                 else {
                     $.messager.alert("友情提示", "获取按钮失败");
                 }
             })
         }

         // 获取该订单的下一个订单状态
         function nextFormBY(FormID) {
             console.log(FormID);
             $.post("/Order_Form/getFormBY", {FormID: FormID }, function (resp) {
                 console.log(resp);
                 if (resp != "" && resp != null) {
                     $('#FormBYx').combobox({
                         valueField: 'ConID',
                         textField: 'ConText',
                         data: resp,
                     })
                 } else {
                     $("#inputDIV").css("display", "none");
                 }
             });
         }

         // 保存
         function baocun() {
             //保存事件
             var postdata = {
                 FormID: $("#FormID").textbox('getValue'),//订单ID
                 MerID: Mer,//商户ID
                 FormBY: $("#FormBYx").textbox("getValue"),//订单状态
                 IntBZ: $("#IntBZ").textbox('getValue'),//原来备注
                 MerBZ: $("#MerBZ").textbox('getValue')//商户追加的备注
             };
             if (postdata.FormBY == "" || postdata.FormBY == null) {
                 $.messager.alert("友情提示", "订餐状态不可为空！");
                 return false;
             }
             $.post("/Order_Form/UpdateOrder_Form?FormID=" + postdata.FormID + "&MerID=" + postdata.MerID + "&FormBY=" + postdata.FormBY + "&IntBZ=" + postdata.IntBZ + "&MerBZ=" + postdata.MerBZ, {}, function (date) {
                 if (date == "1") {
                     $("#editDialog").dialog('close');
                     $("#View").datagrid('reload');
                 }
                 else {
                     $.messager.alert("友情提示", "修改失败，请检查");
                 }
             });
         }

         window.setInterval(showalert, 5000);  //czx:每5秒钟轮循一次，查看新订单.
         function showalert() 
         {
             //Mer = $('#SearchMer').combogrid("getValue");//获取当前商户ID(操作员)

             var OrderIdMax = document.getElementById("orderid").value;  //当前商户的最大订单ID

             $.post("/Order_Form/getOrder?OrderId=" + OrderIdMax, function (date) {
                 if (date != "-1") {  //有新订单到达，则播放声音通知    
                     audio.play();

                     $.messager.show({
                         title: "提示",
                         msg: "有" + date + "条新订单到达！",
                         showType: 'slide'
                     });
                 }
               
             });
            
         } 
          
    </script>

       <script>
           $(function () {
               // Reference the auto-generated proxy for the hub.
               var chat = $.connection.chatHub;
               // Create a function that the hub can call back to display messages.
               chat.client.addNewMessageToPage = function (name, message) {
                   if (name == $('#oi').val()) {

                       $.jGrowl(message, { life: 180000 });
                       // alert(message);
                   }
               };
               $.connection.hub.start().done();
           });
    </script>
</head>
<body  style="padding: 0px">
    <div style="padding:5px; background-color:#F4F4F4">
        <div >
            <a>商户：</a>
            <input id="SearchMer" class="easyui-combogrid" style="width: 120px" />
        </div>
    </div>
    <div >
        <table id="View"></table>
    </div>
    <div id="tb1" style="background-color:#F4F4F4">
        <div style="margin-bottom: 5px;">
            <a href="#" class="easyui-linkbutton" id="btndetail" iconcls="icon-more" onclick="DetailDialog()" plain="true">明细</a>
            <a href="#" id="btnedit" class="easyui-linkbutton" iconcls="icon-edit" onclick="UpdateDialog()" plain="true">修改</a>
        </div>
        <div>
            <a>订单状态：</a>
            <input id="FormControl" class="easyui-combobox" style="width: 120px" />
            <a>订单时间：</a>
            <input id="FormTimeS" class="easyui-datebox" style="width: 120px" />
            <a>至</a>
            <input id="FormTimeE" class="easyui-datebox" style="width: 120px" />
            <a href="#" class="easyui-linkbutton" iconcls="icon-search" onclick="Search()" plain="true">检索</a>
        </div>
    </div>
    <div id="editDialog" class="easyui-dialog" style="width:900px; padding: 10px; height:685px; padding:fixed; top:5px;" closed="true" resizable="true" modal="true" buttons="#dlg-buttons" align="center">
        <form id="editController" method="post" style="padding:10px" novalidate="novalidate">
            <table width="700" id="tbledit" >
                 <tr>
                    <td colspan="5" align="center"; class="userinfo-td-r">
                        <a style="font-size:25px;color:red;text-decoration:none" id="FormBY" ></a>
                    </td>
                </tr>
                <tr>
                    <td width="100" class="userinfo-td-l">订单号：</td>
                    <td width="200" class="userinfo-td-r">
                        <input class="easyui-textbox" type="text" readonly="true" id="FormID" name="FormID" />
                    </td>
                    <td></td>
                    <td width="100" class="userinfo-td-l">商户名称：</td>
                    <td class="userinfo-td-r">
                        <input class="easyui-textbox" type="text" readonly="true" id="MerName" name="MerName" />
                    </td>
                    
                </tr>
                <tr style="display:none">
                    <td class="userinfo-td-l">支付类型：</td>
                    <td class="userinfo-td-r">
                        <input class="easyui-textbox" type="text" readonly="true" id="FormPayType" name="FormPayType" /></td>
                    <td></td>
                    <td width="50" class="userinfo-td-l">支付状态：</td>
                    <td class="userinfo-td-r">
                        <input class="easyui-textbox" type="text" readonly="true" id="IsPay" name="IsPay" /></td>
                </tr>
                <tr>
                    <td width="100" class="userinfo-td-l">下单时间：</td>
                    <td width="200" class="userinfo-td-r">
                        <input class="easyui-textbox" type="text" readonly="true" id="FormTime" name="FormTime" />
                    </td>
                    <td></td>
                    <td class="userinfo-td-l">送餐时间：</td>
                    <td class="userinfo-td-r">
                        <input class="easyui-textbox" type="text" readonly="true" id="SenTime" name="SenTime" />
                    </td>
                </tr>
                <tr>
                    <td class="userinfo-td-l">客户姓名：</td>
                    <td class="userinfo-td-r">
                        <input class="easyui-textbox" type="text" readonly="true" id="AccName" name="AccName" /></td>
                    <td></td>
                    <td width="50" class="userinfo-td-l">联系方式：</td>
                    <td class="userinfo-td-r">
                        <input class="easyui-textbox" type="text" readonly="true" id="AccCall" name="AccCall" />
                    </td>
                </tr>
                <tr>
                    <td width="100" class="userinfo-td-l">送餐地址：</td>
                    <td class="userinfo-td-r" colspan="4"><input class="easyui-textbox" type="text" readonly="true" id="FormAddress" name="FormAddress" style="width:600px" /></td>
                </tr>
                <tr></tr>
                <tr style="text-align:center">
                    <td colspan="5">
                        <table class="easyui-datagrid" id="tableDishes" style="width: 700px; height:190px; padding: 0px;" data-options="fitColumns: false">
                            <thead>
                                <tr>
                                    <th data-options="field:'FormDisheName',width:178,align:'center'">商品名称</th>
                                    <th data-options="field:'FormDishesMon',width:120,align:'center'">单价</th>
                                    <th data-options="field:'FornDishesInt',width:120,align:'center'">积分</th>
                                    <th data-options="field:'FormDishesNun',width:120,align:'center'">数量</th>
                                    <th data-options="field:'FornDishesCount',width:129,align:'center'">总计</th>
                                </tr>
                            </thead>
                        </table>
                    </td>
                </tr>
                 <tr></tr>
                  <tr><td>
                      <a style="padding-right:35px;color:red" >
                         <input type="checkbox" id="IsEva" readonly="true" disabled="disabled" name="IsEva">是否评价</input>
                            </a>
                      </td>

                  </tr>
                <tr>
                    <td colspan="5">
                        
                        <a class="userinfo-td-l">已优惠：</a>
                        <a class="userinfo-td-r">
                            <input class="easyui-textbox" style="width: 80px" type="text" id="FormPreMon" readonly="true" name="FormPreMon" />
                        </a>
                        <a class="userinfo-td-l" style="padding-right:35px">元</a>
                        <a class="userinfo-td-l">实际支付金额：
                        </a>
                        <a class="userinfo-td-r">
                            <input class="easyui-textbox" style="width: 80px"  type="text"  id="FormPayMon" readonly="true" name="FormPayMon" />
                        </a>
                        <a class="userinfo-td-l" style="padding-right:35px">元</a>
                        <a class="userinfo-td-l">消耗积分：
                        </a>
                        <a class="userinfo-td-r">
                            <input class="easyui-numberbox" style="width: 80px" type="text" id="FormPayInt" readonly="true" name="FormPayInt" />
                        </a>
                        <a class="userinfo-td-l">分</a>
                    </td>
                </tr>
                  <tr><td colspan="5">
                      <a class="userinfo-td-l">包装费：</a>
                        <a class="userinfo-td-r">
                            <input class="easyui-textbox" style="width: 80px" type="text" id="DelPackMon" readonly="true" name="DelPackMon" />
                        </a>
                        <a class="userinfo-td-l" style="padding-right:35px">元</a>
                      <a class="userinfo-td-l">配送费：</a>
                        <a class="userinfo-td-r">
                            <input class="easyui-textbox" style="width: 80px;" type="text" id="DelFormMon"   name="DelFormMon" />
                        </a>
                        <a class="userinfo-td-l" style="padding-right:35px">元</a>
                      <a class="userinfo-td-l">是否派送：</a>
                        <a class="userinfo-td-r">
                            <input class="easyui-textbox" style="width: 80px;" type="text" id="isTake" readonly="true"/>
                        </a>
                        <a class="userinfo-td-l" style="padding-right:35px"></a>
                      </td>
                  </tr>
                <tr>
                    <td colspan="5">
                        <a class="userinfo-td-l" style="padding-bottom:10px">客户备注：</a>
                        <input class="easyui-textbox" data-options="multiline:true"  style="width:700px;height:50px;" type="text" id="IntBZ" name="IntBZ" readonly="true"/>
                        <a class="userinfo-td-l" style="padding-bottom:10px">商家补充备注：</a>
                        <input class="easyui-textbox" type="text" data-options="multiline:true"  style="width:700px;height:50px;" id="MerBZ" name="MerBZ"/>
                    </td>
                </tr>
            </table>

            <div align="right" id="SaveButton" style="padding-right:68px">
            </div>

            <div id="inputDIV" style="text-align:right;padding-right:70px">
                <input id="FormBYx" class="easyui-textbox" style="width: 140px; height: 24px">&nbsp;&nbsp;&nbsp;
                <a href="#" id="queren" class="easyui-linkbutton" iconcls="icon-ok" onclick="baocun()">确认</a>
            </div>
        </form>
        <a href="javascript:;" onClick="doPrint()">打印</a>
    </div>
     <div>
        <audio id="audio" preload>
            <!--如果不写controls则不会显示进度条控件如： <audio controls> -->      
            <source src="~/Content/arrive.mp3" type="audio/mp3">
            <source src="~/Content/arrive.ogg" type="audio/ogg"><!--使用IIS必须在IIS中添加ogg的MIME:ogg和audio/ogg -->
            你的浏览器不支持html5的audio标签
        </audio>      
    </div>
    <input id="oi" style="display:none" value="@ViewBag.oe" />
    <input type="text" id="orderid" style="display:none"  />
</body>
</html>
